package com.zengqingfa.examples.mybatisplus.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zengqingfa.examples.mybatisplus.dto.UserQueryVo;
import com.zengqingfa.examples.mybatisplus.dto.UserVo;
import com.zengqingfa.examples.mybatisplus.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @fileName: UserService
 * @author: zengqf3
 * @date: 2021-3-2 14:59
 * @description:
 */
public interface UserService extends IService<User> {
    IPage<User> selectUserPage1(User user);

    IPage<User> selectUserPage2(User user);

    User selectById( Long id);

    User queryById( Long id);

    User selectPreviousRecordById(@Param("id") Long id);


    List<User> selectByUserNameSqlInject(String userName);

    /**
     * 分页
     * @param user
     * @return
     */
    IPage<Map> selectUserPageSpliceSql(UserQueryVo user);

    /**
     * 分页
     * @param user
     * @return
     */
    IPage<Map> selectUserPageWithJsonSerialized(UserQueryVo user);

    /**
     * 分页
     * @param user
     * @return
     */
    IPage<Map> selectUserPageUseCustom(UserQueryVo user);

    /**
     * 导出
     * @param user
     */
    void export(UserQueryVo user);

    /**
     * 查询返回分页数据
     * @param user
     * @return
     */
    IPage<User> selectUserPageWithAnnotation(UserQueryVo user);

    /**
     * 查询用户列表
     * @param user
     * @return
     */
    List<Map> selectUserListWithAnnotation(UserQueryVo user);

    /**
     * 分页
     * @param user
     * @return
     */
    IPage<User> selectUserPageWithModifyColumn(UserQueryVo user);

    /**
     * 分页
     * @param user
     * @return
     */
    IPage<User> selectUserPageWithModifyResultSet(UserQueryVo user);
}
